home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
image
/
fixtx608.zip
/
FIXTEXT.DOC
< prev
next >
Wrap
Text File
|
1996-07-19
|
14KB
|
295 lines
FIXTEXT.DOC 1 Revised: 07-19-96
The FIXTEXT.EXE program applies a character-translation template to any entire
text file. This allows you to change a whole bunch of characters at once.
Features:
* Can process text files of any size.
* Can process DOS text files (lines ending with CR/LF), Mac text files
(lines ending with CR), Unix text files (lines ending with LF), and fixed
length files (lines of a fixed length without any CR or LF characters).
* Can convert any of the above four types of text files to any of the
other types of text files.
* Automatically detects the type of input file if it's a standard text
file (lines ending with CR/LF, CR alone, or LF alone).
* Ideal utility to convert all Unix text files to DOS text files.
* Can be used on binary files but using the /REPLACE option isn't exactly
recommended in this case...
* Can load a user-defined character-translation tables.
* Character-translation tables can let you do things like:
- Convert all lowercase characters to uppercase characters
- Translate IBM graphics characters into standard ASCII text characters;
this is very useful if you want to print the document and are tired of
getting weird stuff printing out.
* Can translate tab characters into spaces.
* Can fix up underscores and other backspace characters.
* Can remove trailing spaces from lines.
* Can create a file showing all lines that were changed.
* Can translate single characters into multiple characters or remove them
entirely.
* The input file specification can include standard DOS wildcards or an
external file (@listfile) containing the files to be processed (although
either prohibits specifying an output file name).
Specifying parameters:
Parameters for this program can be set in the following ways. The last setting
encountered always wins:
- Read from an *.INI file (see BRUCEINI.DOC file),
- Through the use of an environmental variable (SET FIXTEXT=whatever), or
- From the command line (see "Syntax" below)
FIXTEXT.DOC 2 Revised: 07-19-96
The character translation file (lookup tables):
FIXTEXT will process a character-translation (lookup) table if one is found.
This table can be in your standard *.INI file (e.g. FIXTEXT.INI) if desired or
it can be a separate file specified using the /Linitfile parameter.
A sample FIXTEXT.INI file is provided. You can modify this file or create your
own.
If no *.INI file is found (or if "/-I" or "/INULL" is specified), the default
translation table will be loaded. This one is identical to the original
FIXTEXT.INI file and has these characteristics:
- All characters in the decimal 032 to 125 range are left unchanged
- Characters in decimal 24 to 27, and 176 to 223 are considered graphics
characters and are translated into regular text characters, typically
".", "X", "x", "|", "-", and "+"
- Decimal characters 248 to 250 and 254 are changed into asterisks ("*")
- All other characters are translated into spaces
As an example of the graphics character translation that's done, the following:
┌─┬─┐ ╔═╦═╗ +-+-+ +-+-+
│ │ │ ║ ║ ║ | | | | | |
├─┼─┤ ╠═╬═╣ becomes: +-+-+ +-+-+
│ │ │ ║ ║ ║ | | | | | |
└─┴─┘ ╚═╩═╝ +-+-+ +-+-+
It may not look as good but it certainly prints better on most printers.
The lookup table is an ASCII text file which consists of a series of lines in
the following format:
inchar = outstr
where "inchar" is the character to change from and "outstr" is what to change
the character to. Both portions can consist of regular non-space ASCII text
characters (like "A" or "z") as well as hexadecimal values (in the form &Hxx) or
decimal values (in the form \nnn). "outstr" can consist of 0 (the word
"(NONE)"), 1, or 2 or more replacement characters while "inchar" can only
represent a single character. You cannot use a space or equal sign in either
"inchar" or "outstr"; use the hexadecimal or decimal representations instead.
The table does not have to be in any specified order. Lines can end with "/*"
followed by a comment if you want.
Hexadecimal and decimal equivalents are explained in BRUCEHEX.DOC.
FIXTEXT.DOC 3 Revised: 07-19-96
Examples:
a = A /* Translate lowercase "a" into capital "A"
\032 = _ /* Translate space (decimal 032, &H20 too) into underscore
&H0c = <PAGE>\013\010 /* Translate page eject character into chars
/* "<PAGE>" followed by carriage return/line feed
\027 = \032 /* Translate escape character to a space
\027 = (NONE) /* Remove excape characters entirely
Since lines beginning with "/" are treated as command-line defaults, you must
use \047 or &H2F if you want to override the definition of "/".
Note that when characters are not translated into single characters, all of the
single-character translations are performed first and then the remaining
translations are performed in the order they were specified. So something like
the following would result in some lines being changed twice:
A = CAPITAL_A
a = A
In this case, all lowercase "a" characters would first be translated into an
uppercase "A", and then the same character would then be translated into the
string "CAPITAL_A".
FIXTEXT.DOC 4 Revised: 07-19-96
Syntax:
FIXTEXT { filespec | @listfile }
{ outspec [ /OVERWRITE | /-OVERWRITE | /OVERASK ] | /REPLACE }
[ /n ] [ /TO CRLF | /TO CR | /TO LF | /TO n ]
[ /TEXT | /-TEXT | /BINARY ] [ /EJECT=str ] [ /Frptfile | /-F ] [ /-EOF ]
[ /MONO ] [ /Iinitfile | /-I ] [ /Linitfile | /-L ] [ /Q ] [ /? ] [ /?&H ]
"filespec" is the input file specification to process. Can include path and
wildcard information if desired.
"@listfile" allows you to have a variety of file specifications saved in a text
file named "listfile". Each line in the file should consist of one file
specification, each of which can include a path and wildcards if desired. Blank
lines and lines beginning with semi-colons, colons, or quotes are ignored.
"outspec" is the name of the file to create. It can include a drive and path
specification. You have to specify either an outspec or the /REPLACE option. If
your input specification includes more than one file name (either through the
use of wildcards or else by using the @listfile option), "outspec" must be an
output file path, not an individual file name. Otherwise, it has to be an
individual file name.
"/OVERWRITE" says to overwrite the output file if it exists already.
"/-OVERWRITE" says to abort if the output file exists already.
"/OVERASK" says to prompt if the output file exists already; this is the
default.
"/REPLACE" says to write the results to a temporary file and, if the program
finds characters to change and runs successfully, to replace the original file
with the fixed temporary file. The original file is renamed with a BAK
extension if you use this option. You have to specify *either* an output file
name or the /REPLACE option.
"/n" specifies that the input file doesn't have any carriage return or line feed
indicators at all and that, in fact, lines are all fixed length. The routine
automatically detects the standard text files (lines end with CR/LF, CR alone,
or LF alone); only fixed-length input files require this parameter.
"/TO=CRLF" specifies that the output lines are to end with the standard DOS
CR/LF combination.
"/TO=CR" specifies that the output lines are to end with the standar